<?php if($model->checkAdmin || $model->countAlbums) : ?>
	<div class="u_cat">
		<div class="u_cat_head_strip"></div>
		<div class="u_cat_head">
			<a href="<?php echo Yii::app()->createUrl('albums/indexGroup', array('group'=>$model->id));?>">
				<em>Фотоальбомы</em><span><?php echo CHtml::encode($model->countAlbums); ?></span>
			</a>
		</div>
		<?php if($model->countAlbums): ?>
			<div class="u_cat_media albums">
				<?php foreach ($model->albums as $key => $album){ ?>
					<?php $class = (!$key) ? 'u_media' : 'u_media hidden'; ?>
					<a href="<?php echo Yii::app()->createUrl('albums/viewGroup',array('id' => $album->id, 'group'=>$model->id));?>" class="<?php echo $class; ?>" id="audio_<?php echo ($key+1);?>">
						<?php echo  ($album->main_photo!=NULL) ? 
							$this->material_image($album->id, $album->main_photo->name, '180', 'groups/'.$model->id.'/'.$album->id): 
								$this->material_image(0, 'noimage.gif', '180', ''); ?>
					</a>
				<?php } ?>	
				<div class="u_media_nav">
					<div class="u_media_nav_prev"></div>
					<div class="u_media_nav_next"></div>
					<?php foreach ($model->albums as $key => $album){ ?>
						<?php $class = (!$key) ? 'u_media_nav_name' : 'u_media_nav_name hidden'; ?>
						<a href="<?php echo Yii::app()->createUrl('albums/viewGroup',array('id' => $album->id, 'group'=>$model->id));?>" class="<?php echo $class; ?>" id="audio_<?php echo ($key+1);?>_"><?php echo CHtml::encode($album->name); ?></a>
					<?php } ?>
				</div>
			</div>
		<?php else : ?>
		<div class="u_cont_list">
			<div class="u_cont">
				<div class="u_cont_r_empty ajaxLinks">
					В сообществе ещё нет мероприятий.
					<?php if(isset( $model->checkAdmin )) : ?>
						<p><a href="<?php echo Yii::app()->createUrl('albums/createGroup', array('group'=>Yii::app()->request->getParam('group')));?>" class="u_cont_h2_discussion ajaxLink">
							Добавить 
						</a></p>
					<?php endif ?>
				</div>
			</div>
		</div>
		<?php endif; ?>
	</div>
<?php endif; ?>
